package org.sang.bbbig.config;

import org.sang.bbbig.obstacle.MyInterceptor1;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyWebMvcConfigurer implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry
                .addResourceHandler("/static/**")
                .addResourceLocations("classpath:/static/");
        registry
                .addResourceHandler("/uploadFile/**")
                .addResourceLocations("file:D:/study/task-4/uploadFile/");

    }

    @Override
    public void  addInterceptors(InterceptorRegistry registry){
//    registry.addInterceptor(new MyInterceptor1())
//            .addPathPatterns("/**")
//            .excludePathPatterns("/index");
//             .excludePathPatterns("/login");

    }
}